package com.bestcem.xm.user.grpc.service.param;

import com.bestcem.xm.common.core.constant.RegTypes;
import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * 开放平台的层级树更新参数
 *
 * @author wangyunyun <yunyun.wang@idiaoyan.com>
 * @version v1.0
 * @date 2022/2/21 10:47
 */
@Getter
@Setter
public class OpenGroupTreeParam {

    /**
     * 层级列表
     */
    @NotEmpty(message = "4;group_level_list is required")
    @Size(max = 15, min = 2, message = "7;group_level_list length should be between 2 and 15")
    @Valid
    private List<GroupLevelSyncParam> levels;

    /**
     * 组织列表
     */
    @NotEmpty(message = "4;group_list is required")
    @Size(max = 100000, message = "7;group_list length cannot be exceed 100000")
    @Valid
    private List<GroupSyncParam> groups;

    /**
     * 组织id
     */
    @NotBlank(message = "4;org_id cannot be blank")
    @Pattern(regexp = RegTypes.OBJECT_ID, message = "5;org_id format error")
    private String orgId;

}
